package io.jft.doll.api

import io.jft.doll.room.entity.remote.WxAccessTokenREntity
import io.jft.doll.room.entity.remote.WxUserInfoREntity
import io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.Query

/**
 * Created by G on 2017/12/23 0023.
 */
interface WxApi {
    @GET("https://api.weixin.qq.com/sns/oauth2/access_token")
    fun getOauth2(@Query("appid") appId: String,
                  @Query("secret") secret: String,
                  @Query("code") code: String,
                  @Query("grant_type") type: String): Observable<WxAccessTokenREntity>

    @GET("https://api.weixin.qq.com/sns/userinfo")
    fun getUserInfo(@Query("access_token") token: String,
                    @Query("openid") openid: String): Observable<WxUserInfoREntity>
}